package com.beaven.imclient.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.AttrRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.beaven.imclient.R;

/**
 * author: Beaven
 * time: 2017/5/22 15:47
 */

public class DesEdit extends FrameLayout {

  TextView text_des_edit;
  EditText edit_item;

  public DesEdit(@NonNull Context context) {
    this(context, null);
  }

  public DesEdit(@NonNull Context context, @Nullable AttributeSet attrs) {
    this(context, attrs, 0);
  }

  public DesEdit(@NonNull Context context, @Nullable AttributeSet attrs,
      @AttrRes int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.DesEdit);
    String desText = array.getString(R.styleable.DesEdit_desText);
    array.recycle();
    View view = inflate(context, R.layout.layout_edit_login, this);
    text_des_edit = (TextView) view.findViewById(R.id.text_des_edit);
    text_des_edit.setText(desText);
    edit_item = (EditText) view.findViewById(R.id.edit_item);
  }

  public EditText getEditText() {
    return edit_item;
  }
}
